# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/4/20 9:11
# @Author  : qiaoc
# @File    : mainModule.py
# @Desc    :


import logging

class mainModule:

    def __init__(self):

        logger = logging.getLogger("mainLogModule")
        logger.setLevel(level=logging.INFO)
        # logger.setLevel(level = logging.NOTSET)
        handler = logging.FileHandler(r"F:\err_log.log")
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        handler.setFormatter(formatter)

        console = logging.StreamHandler()
        console.setLevel(logging.INFO)
        console.setFormatter(formatter)

        logger.addHandler(handler)
        logger.addHandler(console)

        self.__logger = logger

    def getLogging(self,className):
        return logging.getLogger('mainLogModule.【'+className+'】')